import { ExtractPropTypes } from "vue"

/**
 * 点击事件返回数据类型
 */
 export interface SwipeActionEvent {
  /** 点击类型 */
  type: 'item' | 'button',
  /** item标识 */
  name: string | number,
  /** 对应的序号 */
  index: number
}

/**
 * props参数
 */
export const swipeActionProps = {
  /** 自动关闭其他swipe按钮 */
  autoClose: {
    type: Boolean,
    default: true
  }
}
export type SwipeActionProps = ExtractPropTypes<typeof swipeActionProps>

export const swipeActionEmits = {
  /** 点击事件 */
  click: (event: SwipeActionEvent) => true
}
export type SwipeActionEmits = typeof swipeActionEmits